package com.framework.wz.wutong.rx;

import com.framework.wz.wutong.base.IView;

import io.reactivex.observers.ResourceObserver;

public class BaseObserver<T> extends ResourceObserver<T> {

    private IView mView = null;

    public BaseObserver(IView mView){
        this.mView = mView;
    }

    @Override
    public void onNext(T t) {
        if (mView != null) {
            mView.dismissProgress();
        }
    }

    @Override
    public void onError(Throwable e) {
        if (mView != null) {
            mView.dismissProgress();
        }
    }

    @Override
    public void onComplete() {

    }
}
